package com.zy.springcloud.cloudconsumeruser.service;

import com.zy.springcloud.cloudconsumeruser.service.exp.MovieServiceFeignExceptionHandler;
import com.zy.springcloud.movie.bean.Movie;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//@FeignClient(value = "cloud-provider-movie") //与被调用端的服务名称一致
@FeignClient(value = "cloud-provider-movie",fallback = MovieServiceFeignExceptionHandler.class) //与被调用端的服务名称一致
public interface MovieServiceFeign {
    //feign的接口声明要与movie服务的接口声明一致
    @GetMapping("/getmovie/{id}")
    public Movie getNewMovie(@PathVariable("id") Integer id);
}